﻿@using MvcDeviceManager.Models
@helper treeMenu(IList<Menu> list)
    {
    <ul>
    @foreach (MvcDeviceManager.Models.Menu menu in list)
    {
        <li>
        @if (menu.Children!=null && menu.Children.Count > 0)
        {
            @menu.MenuName
            @treeMenu(menu.Children)
        }else{
             <a href="@Url.Content(@menu.Url)">@menu.MenuName</a>
        }
        </li> 
    }
    </ul>
}
<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
</head>

<body>
    <div id="header">
        header
        <div style="float:right;">@Html.ActionLink("注销","LogOut","Login")</div>
    </div>
    <div>
        <div id="menu">
        @treeMenu((IList<Menu>)@Session["menu"])
        </div>
        <div>
        @RenderBody()
        </div>
    </div>
    <div id="bottom">
        bottom
    </div>
</body>
</html>
